Skip to content

Dockerfile: reorder instructions for caching#132

Draft
thaJeztah wants to merge 1 commit into
distribution:masterfrom
thaJeztah:optimize_dockerfile
Draft

Dockerfile: reorder instructions for caching#132
thaJeztah wants to merge 1 commit into
distribution:masterfrom
thaJeztah:optimize_dockerfile

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

Move things that change less to the start to allow them being cached

Move things that change less to the start to allow them being cached

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Comment thread Dockerfile
Comment on lines +5 to +6
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/etc/docker/registry/config.yml"]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only "downside" is that technically, if a build fails here, it's non-functional (as the entrypoint etc are not yet copied)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine 🤔

@thaJeztah
Copy link
Copy Markdown
Member Author

TBH; not sure how much this brings in practice as the image would only be rebuilt;

  • if alpine changes (which would require a full rebuild anyway)
  • if a new release happens

It would be beneficial if a new release happens, but alpine did not change (e.g. if there would be nightly builds of distribution, and those would be built with the classic builder)

@milosgajdos milosgajdos requested a review from crazy-max February 2, 2022 16:27
@crazy-max
Copy link
Copy Markdown
Contributor

Yeah not sure it gives that much as improvement imo. I also think it can be confusing with other dockerfiles that have this info at the end but not really against it.

@milosgajdos
Copy link
Copy Markdown
Member

Alright, probably not worth it 🤔 Feel free to close @thaJeztah

@thaJeztah thaJeztah marked this pull request as draft February 4, 2022 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants